﻿using Microsoft.Phone.Scheduler;
using MS.TravelJourney.Final.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MS.TravelJourney.Final.Core
{
    public class NotificationsCore
    {
        //public static void SetRemainder(ItemViewModel item)
        //{
        //    if (!IsScheduled(item.UniqueId))
        //    {
        //        Microsoft.Phone.Scheduler.Reminder reminder = new Microsoft.Phone.Scheduler.Reminder(item.UniqueId);
        //        reminder.Title = item.Name;
        //        reminder.Content = "Did you finished?";
        //        if (System.Diagnostics.Debugger.IsAttached)
        //            reminder.BeginTime = DateTime.Now.AddMinutes(1);
        //        //else
        //            //reminder.BeginTime = DateTime.Now.Add(TimeSpan.FromMinutes(Convert.ToDouble(item.PrepTime)));
        //        reminder.ExpirationTime = reminder.BeginTime.AddMinutes(5);
        //        reminder.RecurrenceType = RecurrenceInterval.None;
        //        //reminder.NavigationUri = new Uri("/RecipeDetailPage.xaml?ID=" + item.UniqueId + "&GID=" + item.Group.UniqueId, UriKind.Relative);
        //        ScheduledActionService.Add(reminder);
        //    }
        //    else
        //    {
        //        var schedule = ScheduledActionService.Find(item.UniqueId);
        //        ScheduledActionService.Remove(schedule.Name);
        //    }
        //}

        //public static bool IsScheduled(string name)
        //{
        //    var schedule = ScheduledActionService.Find(name);
        //    if (schedule == null)
        //    {
        //        return false;
        //    }
        //    else
        //    {
        //        return schedule.IsScheduled;
        //    }
        //}
    }

}
